package test01.demo02;

/**
 * 对等级进行封装的一个类 - 表达等级只能是A B C D E 五种状态
 * @author CSY
 * @date 2025 - 04 - 09
 */
public class Grade {
    //等级字符串的表示
    private String value;

    private Grade(){}

    private Grade(String value){
        this.value = value;
    }

    //在类内部，实例化五个对象 - 预设五个状态
    public static final Grade A = new Grade("优秀");
    public static final Grade B = new Grade("良好");
    public static final Grade C = new Grade("中等");
    public static final Grade D = new Grade("合格");
    public static final Grade E = new Grade("不合格");

    @Override
    public String toString() {
        return this.value;
    }
}
